The Clone
method creates a new instance of the HapticPattern
class that is a copy of the current instance. This method is useful when you need to duplicate a haptic pattern with the same properties and values.
The Clone
method creates a new instance of the HapticPattern
class that is a copy of the current instance. This method is useful when you need to duplicate a haptic pattern with the same properties and values.
To use the Clone
method, call it on an existing HapticPattern
instance. The method returns a new HapticPattern
object that is a copy of the original.
// Create an instance of HapticPattern HapticPattern originalPattern = new HapticPattern(); // Clone the original pattern HapticPattern clonedPattern = originalPattern.Clone(); // Now you have two separate instances with the same properties // You can modify clonedPattern without affecting originalPattern clonedPattern.Length = 2.0f; // Example modification